﻿using System.Threading;
using System.Windows;

namespace BrowserHelper.CefSupport
{
    public class CefObj
    {
        private SynchronizationContext _context;

        public CefObj(SynchronizationContext context)
        {
            this._context = context;
        }

        public void ShowMsg(string msg)
        {
            MessageBox.Show(msg);
        }

        public void UpdateTime(string timeStr)
        {
            _context.Send(x =>
            {
                if (Application.Current.MainWindow is MainWindow window)
                    window.LbTime.Content = timeStr;
            }, null);
        }
    }
}